Skip to content

Feature: functions commands (list, delete, pull, deploy, unified deploy)#412

Merged
yardend-wix merged 9 commits intomainfrom
feature/functions-commands
Mar 16, 2026
Merged

Feature: functions commands (list, delete, pull, deploy, unified deploy)#412
yardend-wix merged 9 commits intomainfrom
feature/functions-commands

Conversation

@yardend-wix
Copy link
Contributor

@yardend-wix yardend-wix commented Mar 12, 2026

Note

Description

This PR expands the functions command group with three new subcommands (list, delete, pull) and significantly refactors the deploy subcommand. Deployment now happens function-by-function sequentially with real-time per-function progress feedback, supports selective deployment by name, and adds a --force flag to prune remote functions not present locally. The underlying API layer was also refactored from a single batch endpoint to individual per-function endpoints.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • functions list — new command that fetches and displays all deployed functions on the remote, including automation counts
  • functions delete [names...] — new command to delete one or more functions by name (supports comma-separated and variadic args); gracefully handles 404s
  • functions pull [name] — new command to pull deployed function code from Base44 to local disk; skips files already matching remote content; optionally scoped to a single function by name
  • functions deploy refactor — now accepts optional [names...] to deploy a subset, shows step-by-step [n/total] progress per function, and adds --force to delete remote-only functions after deploying
  • Core API refactor (core/resources/function/api.ts) — replaced single-batch deployFunctions with deploySingleFunction, deleteSingleFunction, and listDeployedFunctions targeting per-function REST endpoints
  • Schema updates (schema.ts) — replaced DeployFunctionsResponseSchema with DeploySingleFunctionResponseSchema, added FunctionInfoSchema and ListFunctionsResponseSchema
  • Core deploy logic (core/resources/function/deploy.ts) — extracted deployFunctionsSequentially and pruneRemovedFunctions with callback hooks for live progress reporting
  • New core pull module (core/resources/function/pull.ts) — writeFunctions writes remote function files locally and skips unchanged files via deep-equality checks
  • Tests — added functions_delete.spec.ts, functions_list.spec.ts, functions_pull.spec.ts; updated functions_deploy.spec.ts and TestAPIServer with new mock endpoints

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

The pull command writes a function.jsonc config file plus all source files into <functionsDir>/<name>/. It compares local file contents against the remote before writing, so re-running pull on an already-synced repo produces no writes. The --force flag on deploy is mutually exclusive with specifying function names by design.


🤖 Generated by Claude | 2026-03-16 00:00 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.44-pr.412.e4034f6

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.44-pr.412.e4034f6"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.44-pr.412.e4034f6"
  }
}

Preview published to npm registry — try new features instantly!

yardend-wix and others added 4 commits March 12, 2026 16:58
Replace narrow 3-field automation type with full discriminated union
matching the schema (scheduled one-time, cron, simple, entity).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@kfirstri kfirstri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

@yardend-wix yardend-wix merged commit 3d92f42 into main Mar 16, 2026
10 checks passed
@yardend-wix yardend-wix deleted the feature/functions-commands branch March 16, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants